<template>
	<view class="order-box">
		<block v-if="status == '待报价'">
			<block v-if="orderList0.length">
				<scroll-view class="list" scroll-y="true" @scrolltolower="onLoadMore">
					<view v-for="(item, index) in orderList0" :key="index">
						<WaitPrice></WaitPrice>
					</view>  
				</scroll-view>
			</block>
			<block v-else>
				没有数据
			</block>
		</block>
		<block v-if="status == '已报价'">
			<block v-if="orderList1.length">
				<scroll-view class="list" scroll-y="true" @scrolltolower="onLoadMore">
					<view v-for="(item, index) in orderList1" :key="index">
						<PriceDone></PriceDone>
					</view>  
				</scroll-view>
			</block>
			<block v-else>
				没有数据
			</block>
		</block>
		<block v-if="status == '服务中'">
			<block v-if="orderList2.length">
				<scroll-view class="list" scroll-y="true" @scrolltolower="onLoadMore">
					<view v-for="(item, index) in orderList2" :key="index">
						<Servicing></Servicing>
					</view>  
				</scroll-view>
			</block>
			<block v-else>
				没有数据
			</block>
		</block>
		<block v-if="status == '已完成'">
			<block v-if="orderList3.length">
				<scroll-view class="list" scroll-y="true" @scrolltolower="onLoadMore">
					<view v-for="(item, index) in orderList3" :key="index">
						<Finished></Finished>
					</view>  
				</scroll-view>
			</block>
			<block v-else>
				没有数据
			</block>
		</block>
	</view>
</template>

<script>
	import WaitPrice from './WaitPrice'
	import PriceDone from './PriceDone'
	import Servicing from './Servicing'
	import Finished from './Finished'
	export default {
		name: "orderpage",
		data() {
			return {}
		},
		props: {
			'orderList0': {
				default: []
			},
			'orderList1': {
				default: []
			},
			'orderList2': {
				default: []
			},
			'orderList3': {
				default: []
			},
			'status': {
				default: ''
			}
		},
		components: {
			WaitPrice,
			PriceDone,
			Servicing,
			Finished
		},
		methods: {
			onLoadMore(){
				console.log('4444')
				this.$emit('loadMoreData')
			}
		}
	}
</script>

<style>
	.list {
		height: 100vh;
	}
</style>
